package org.example.Thread01;

/**
 * 线程池01
 */
public class Dome_Thread14 {
    public static void main(String[] args) {
        Student s1=Student.createStudentByAgeAndName(18,"张三");
        Student s2=Student.createStudentByClassIdAndName(1,"李四");
        System.out.println(s1);
        System.out.println(s2);
    }
}
class Student{
    private int age;
    private int id;
    private int classId;
    private String name;
    //通过age和name初始化一个对象
    public static Student createStudentByAgeAndName(int age,String name){
        Student student=new Student();
        student.setAge(age);
        student.setName(name);
        return student;
    }

    //通过classId和name来初始化一个对象
    public static Student createStudentByClassIdAndName(int classId,String name){
        Student student=new Student();
        student.setClassId(classId);
        student.setName(name);
        return student;
    }
    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getClassId() {
        return classId;
    }

    public void setClassId(int classId) {
        this.classId = classId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
